''' 练习 创建学生类'''

# class Students():
#     def set_info(self,name,age=0):
#         '用来设置学生的相关属性'
#         self.name = name
#         self.age = age
#
#     def show_info(self):
#         '用来打印出学生的相关信息'
#         print('学生姓名：{}  年龄：{}'.format(self.name, self.age))
#
# stu1 = Students()
# stu1.set_info('桦树',26)
# stu1.show_info()

class Students():
    def __init__(self,id,name,score):
        self.id = id
        self.name = name
        self.score = score

    def show_info(self):
        print("{}{}{}".format(self.id,self.name,self.score))

    def set_score(self,score):
        self.score = score
        

stu1 = Students('1001','花花',99)
stu1.show_info()
stu1.set_score(100)
stu1.show_info()